package com.jsh.erp.datasource.mappers;

import com.jsh.erp.datasource.entities.DepotItem;
import com.jsh.erp.datasource.entities.DepotItemExample;
import java.util.List;

import com.jsh.erp.datasource.entities.DepotItemVo4Material;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

public interface DepotItemMapper {
    long countByExample(DepotItemExample example);

    int deleteByExample(DepotItemExample example);

    int deleteByPrimaryKey(Long id);

    int insert(DepotItem record);

    int insertSelective(DepotItem record);

    List<DepotItem> selectByExample(DepotItemExample example);

    /**
     * 查询主订单的子订单信息
     * @param headerId
     * @return
     */
    List<DepotItemVo4Material> selectByHeadId(Long headerId);

    DepotItem selectByPrimaryKey(Long id);

    DepotItem selectByNumber(@Param("number") String number);

    int updateByExampleSelective(@Param("record") DepotItem record, @Param("example") DepotItemExample example);

    int updateByExample(@Param("record") DepotItem record, @Param("example") DepotItemExample example);

    int updateByPrimaryKeySelective(DepotItem record);

    int updateByPrimaryKey(DepotItem record);

    int updateStatusById(Long id);

    @Delete("delete from jsh_depot_head where link_number = #{number}")
    void deleteByNumber(@Param("number") String number);

    @Delete("delete from jsh_depot_item where header_id = #{headerId}")
    int deleteByHeadId(@Param("headerId") Long headerId);

}